package hy.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ant")
public class AntCtrl {
    /*
    localhost/ant/p1---无法访问
    ocalhost/ant/p1/---ok
    localhost/ant/p1/abc--ok
    localhost/ant/p1/abc/123--无法访问
    */
    @GetMapping("/p1/*")
    public String a1(){
        return "a1";
    }

    /*
    localhost/ant/p2/a/b---ok
    localhost/ant/p2/abc--ok
    localhost/ant/p2/--ok
    localhost/ant/p2--ok
    */
    @RequestMapping("/p2/**")
    public void a2(){
        System.out.println("p2");
    }

    /*
    http://localhost/ant/p3/ab--无法访问
    http://localhost/p1/m5/a---ok
    */
    @RequestMapping("/p3/?")
    public void a3(){
        System.out.println("p3");
    }
}